from base.base import Base
from selenium.webdriver.common.by import By
from time import sleep

class GwcPage(Base):
    # 点击购物车
    gouwuche='new UiSelector().resourceId("com.achievo.vipshop:id/space1")'
    # 点击第一个框 4.19
    yikuang=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout[2]/android.widget.RelativeLayout/android.widget.FrameLayout[1]/android.widget.RelativeLayout/android.widget.RelativeLayout/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.widget.RelativeLayout[2]/android.widget.RelativeLayout/android.widget.LinearLayout[2]/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.TextView[1]')
    # 点击 4.29
    yifu=(By.ID,'ltart_1744857621714955')
    # 点击 搜索框
    souuso=(By.XPATH,'//android.widget.TextView')
    # 点击 输入框
    shuru=(By.ID,'com.achievo.vipshop:id/mask_search_hint')
    # 断言1
    dy1=(By.ID,'com.achievo.vipshop:id/text_sales_volume')
    # 断言2 品牌
    dy2=(By.ID,'com.achievo.vipshop:id/tips')
    # 断言3
    dy3=(By.XPATH,'//android.widget.TextView')
    def gwcyewu(self,content):
        self.loc_ui_ele(self.gouwuche).click()
        sleep(3)
        self.loc_wait_ele(self.yikuang).click()
        sleep(3)
        self.loc_ele(self.yifu).click()
        sleep(3)
        self.loc_ele(self.souuso).click()
        sleep(3)
        self.loc_ele(self.shuru).send_keys(content)
        sleep(3)
